package com.bobi.controller;

import com.bobi.entity.Goods;
import com.bobi.mapper.GoodsMapper;
import com.bobi.pojo.condition.Condition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/goods")
public class GoodsController {
    @Autowired
    private GoodsMapper goodsMapper;

    @GetMapping("/search")
    public List<Goods> searchAllGoods(){
       return goodsMapper.getAllGoods();
    }



    @PostMapping("/search1")
    public List<Goods> searchGoods(@RequestBody Condition condition) {
        System.out.println(condition);
        return goodsMapper.getGoods(condition);
    }
}
